﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Empires.CRL.DataContract;

namespace Empires.RAL.Access
{
    public interface IAppBlogAccess
    {
        /// <summary>
        /// 获得博文
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        DefaultDataPack GetArticle(int id);
        /// <summary>
        /// 获取博文评论列表
        /// </summary>
        /// <param name="articleId"></param>
        /// <param name="page"></param>
        /// <param name="takeitem"></param>
        /// <returns></returns>
        List<DefaultDataPack> GetArticleReply(int articleId, int page, int takeitem);
        /// <summary>
        /// 发表评论
        /// </summary>
        /// <param name="articleId"></param>
        /// <param name="author"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        int PostArticleReply(int articleId, string author, string content);
        /// <summary>
        /// 发表博文
        /// </summary>
        /// <param name="pbdate"></param>
        /// <param name="author"></param>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        int PostArticle(DateTime pbdate, string author, string title, string mainimg,string shortimg, string content);
        /// <summary>
        /// 编辑博文
        /// </summary>
        /// <param name="id"></param>
        /// <param name="author"></param>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <returns></returns>
        int EditArticle(int id, string author, string title, string content);
        /// <summary>
        /// 删除博文
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        int DeleteArticle(int id);
        /// <summary>
        /// 获得官方博文列表
        /// </summary>
        /// <param name="page">第几页 0开始</param>
        /// <param name="takeitem">每页携带多少条记录</param>
        /// <returns></returns>
        IEnumerable<DefaultDataPack> GetBlogs(int page, int takeitem);

        /// <summary>
        /// 获取热门博文
        /// </summary>
        /// <param name="takeitem"></param>
        /// <returns></returns>
        IEnumerable<DefaultDataPack> GetPopularBlogs(int takeitem);
    }
}
